<?php
if($_REQUEST['client'] > 0)
{ $sites = getSitesList($_REQUEST['client']); }
?>
<div class="menu_top">
	<input type="hidden" name="action" value="site_list">
	<input type="submit" value="Add new site" class="buttons" style="padding-left:20px; padding-right:10px;  background-image: url('../images/system/new.gif'); border:1px solid #DDDDDD;" />&nbsp;&nbsp;
	Title:&nbsp;&nbsp;<input name="new_title[]" type="text" value="" maxlength="99" size="12">
	<input type="submit" value="Save" style="padding-left:20px; padding-right:10px;  background-image: url('../images/system/save.gif'); border:1px solid #DDDDDD; height:20px;" class="buttons">
</div>
<div class="menu_list">
<table id="menulist" class="item_list" cellspacing="0" cellpadding="0" border="0">
	<tr>
		<th nowrap="nowrap">#&nbsp;Site ID&nbsp;&nbsp;</th>
		<th nowrap="nowrap">Title&nbsp;&nbsp;</th>
		<th nowrap="nowrap">URL&nbsp;&nbsp;</th>
		<th nowrap="nowrap">License Code&nbsp;&nbsp;</th>
		<th nowrap="nowrap">Language&nbsp;&nbsp;</th>
		<th nowrap="nowrap">Analytics ID&nbsp;&nbsp;</th>
		<th nowrap="nowrap">Active&nbsp;&nbsp;</th>
		<th nowrap="nowrap">Edit&nbsp;&nbsp;</th>
		<th nowrap="nowrap">Delete&nbsp;&nbsp;</th>
	</tr>
	<?php 
	if($sites):
	foreach($sites as $site)
	{
	?>
	<tr class="items">
		<td nowrap="nowrap">
			# <input type="hidden" name="site_id[]" value="<?php echo $site['id']; ?>" /> <?php echo $site['id']; ?>
		</td>
		<td nowrap="nowrap"><input style="width:80px;" class="inp_txt" name="title[]" type="text" value="<?php echo $site['title']; ?>" maxlength="90" /></td>
		<td nowrap="nowrap"><input style="width:120px;" class="inp_txt" name="site_url[]" type="text" value="<?php echo $site['site_url']; ?>" maxlength="90" /></td>
		<td nowrap="nowrap"><input style="width:120px;" class="inp_txt" name="license[]" type="text" value="<?php echo $site['license']; ?>" maxlength="90" /></td>
		<td nowrap="nowrap">
			<select name="language[]" style="width:80px;" onChange="submit()">
				<option value="en" <?php if ($site['language'] == 'en'){echo 'selected="selected"'; }?> >English</option>
				<option value="no" <?php if ($site['language'] == 'no'){echo 'selected="selected"'; }?> >Norwegian</option>
				<option value="ba" <?php if ($site['language'] == 'bs'){echo 'selected="selected"'; }?> >Bosnian</option>
			</select>
		</td>
		<td nowrap="nowrap"><input style="width:80px;" class="inp_txt" name="analytics_id[]" type="text" value="<?php echo $site['analytics_id']; ?>" maxlength="90" /></td>
		<td nowrap="nowrap"><?php echo getActivationFields($site); ?></td>
		<td nowrap="nowrap">
			<a href="?con=<?php echo $_REQUEST['con']; ?>&item=<?php echo $site['id']; ?>"><img src="../images/system/templ.gif" border="0" /></a>&nbsp;
		</td>
		<td nowrap="nowrap"><input class="inp_image" type="image" name="delete_site" src="../images/system/trash_25.gif" value="0" onclick="this.value='<?php echo $site['id']; ?>'; edit_form.submit();" /></td>
	</tr>
	<?php
	}
	?>
    <?php endif; ?>
</table>
<input type="hidden" id="activate" name="activate" value="0" />
<input type="hidden" id="deactivate" name="deactivate" value="0" />
</div>
